package demo1;

public class Test {
    public static void main(String[] args) {
        MySingleList mySingleList = new MySingleList();
        mySingleList.createList();
        //System.out.println("12346");
        mySingleList.display();
        mySingleList.size();
        System.out.println(mySingleList.contains(132));//false
        System.out.println(mySingleList.contains(23));//true

        mySingleList.addLast(27);
        mySingleList.display();
        System.out.println("======");
        mySingleList.addIndex(0,25);
        mySingleList.display();
        mySingleList.addIndex(5,37);
        mySingleList.display();
        mySingleList.addIndex(3,61);
        mySingleList.display();
        mySingleList.remove(1);
        mySingleList.remove(61);
        mySingleList.display();

        mySingleList.addIndex(2,20);
        mySingleList.addIndex(6,20);
        mySingleList.addIndex(4,20);
        mySingleList.display();
        mySingleList.removeAll(20);
        mySingleList.display();
       /* mySingleList.clear();
        mySingleList.display();*/
        mySingleList.reverseList();
        mySingleList.display();
        System.out.println("---------------");
        MySingleList.ListNode ret1 = mySingleList.middleNode();
        System.out.println(ret1.val);

        System.out.println("--------------");
        MySingleList.ListNode ret2 = mySingleList.findKthTOTail(6);
        System.out.println(ret2.val);

        //合并所用
        MySingleList mySingleList1 = new MySingleList();
        mySingleList1.addLast(12);
        mySingleList1.addLast(23);
        mySingleList1.addLast(34);
        mySingleList1.addLast(45);
        mySingleList1.addLast(56);
        MySingleList mySingleList2 = new MySingleList();
        mySingleList2.addLast(8);
        mySingleList2.addLast(15);
        mySingleList2.addLast(30);
        mySingleList2.addLast(40);
        mySingleList2.addLast(78);
        mySingleList2.display();



    }
}
